package A1_3;

public class Main {
    public static void main(String[] args) {
        // Create School
        School school = new School();

        // Create Departments
        Department csDept = new Department("Computer Science");
        Department mathDept = new Department("Mathematics");

        // Add Departments to School
        school.addDepartment(csDept);
        school.addDepartment(mathDept);

        // Create Subjects
        Subject javaSubject = new Subject("Java Programming");
        Subject calcSubject = new Subject("Calculus");

        // Create Instructors
        Instructor javaInstructor = new Instructor("John Doe", csDept);
        Instructor calcInstructor = new Instructor("Jane Smith", mathDept);

        // Add Subjects to Departments
        csDept.addSubject(javaSubject);
        mathDept.addSubject(calcSubject);

        // Add Instructors to Departments
        csDept.addInstructor(javaInstructor);
        mathDept.addInstructor(calcInstructor);

        // Assign Subjects to Instructors
        javaInstructor.addTaughtSubject(javaSubject);
        calcInstructor.addTaughtSubject(calcSubject);

        // Create Students
        Student student1 = new Student("Alice");
        Student student2 = new Student("Bob");

        // Enroll Students in Subjects
        student1.addEnrolledSubject(javaSubject);
        student1.addEnrolledSubject(calcSubject);
        student2.addEnrolledSubject(javaSubject);

        // Print out some information to verify relationships
        System.out.println("School Departments: " + school.getDepartments().size());
        for (Department dept : school.getDepartments()) {
            System.out.println("Department: " + dept.getName());
            System.out.println("Instructors: " + dept.getInstructors().size());
            System.out.println("Subjects: " + dept.getSubjects().size());
        }

        System.out.println("Student1 Enrolled Subjects: " + student1.getEnrolledSubjects().size());
        System.out.println("Student2 Enrolled Subjects: " + student2.getEnrolledSubjects().size());
    }
}